'use strict'
const SUN = require('./base/sun')

SUN.pathName = __filename

SUN.init()
require('./request/request')
require('./code/nodeCallMgr')
//require('./dao/db')

const gateServer = require('./code/gateServer')  //网关服务器
const rootServer = require('./code/rootServer')  //根服务器
const nodeSerHandle = require('./code/nodeSerHandle')


SUN.on('rootSerStart', function () {
    nodeSerHandle.start()
})

gateServer.createServer()
rootServer.createServer()
if (SUN.env === 'production') {
    process.on('uncaughtException', function (err) {
        //打印出错误
        console.error(err)
        //打印出错误的调用栈方便调试
        console.error(err.stack)
    })
}
